package com.iswust.mianzhoutong.sign.model.dto;

import com.iswust.mianzhoutong.sign.consts.RewardConst;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;


import java.security.InvalidParameterException;
import java.time.LocalDate;
import java.util.Calendar;
import java.util.Date;
import java.util.regex.Pattern;


/**
 * @author liushuai
 * @create 2022-07-14 17:50
 */
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class SignSummaryDto {

    /**
     * 月签到天数
     */
    private Integer monthSignDays;

    /**
     * 年初到今日的累计签到数
     */
    private Integer yearSignDays;

    /**
     * 剩余的补签次数
     */
    private Integer monthReplenishNumbers;

    /**
     * 最新的签到日期
     */
    private Date lastSignDate;


    /**
     * 返回漏签天数
     * @return  本月的漏签天数
     */
    public Integer getMonthLackDays() {
        LocalDate now = LocalDate.now();
        int dayOfMonth = now.getDayOfMonth();
        return dayOfMonth - monthSignDays;
    }

    public Integer getMonthSignDays() {
        return monthSignDays;
    }

    public void setMonthSignDays(Integer monthSignDays) {
        this.monthSignDays = monthSignDays;
    }

    public Integer getYearSignDays() {
        return yearSignDays;
    }

    public void setYearSignDays(Integer yearSignDays) {
        this.yearSignDays = yearSignDays;
    }

    public Integer getMonthReplenishNumbers() {
        return monthReplenishNumbers;
    }

    public void setMonthReplenishNumbers(Integer monthReplenishNumbers) {
        this.monthReplenishNumbers = monthReplenishNumbers;
    }

    public Date getLastSignDate() {
        return lastSignDate;
    }

    public void setLastSignDate(Date lastSignDate) {
        this.lastSignDate = lastSignDate;
    }
}
